package com.jisf.driver.controller;

import com.jisf.driver.entity.po.User;
import com.jisf.driver.response.Result;
import com.jisf.driver.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Classname LoginController
 * @Description TODO
 * @Date 2022/4/7 12:41
 * @Created by jisf：【429627912@qq.com】
 */
@RestController
@RequestMapping("user")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("login")
    public Result<?> login(@RequestBody User user){
        return loginService.login(user);
    }

    @GetMapping("logout")
    public Result<?> logout(){
        return loginService.logout();
    }
}
